/*
 * Copyright © 2023
 * @Author: zhangxiang
 * @Date: 2023-05-15 16:28:13
 * @LastEditors: zhangxiang
 * @LastEditTime: 2023-09-23 14:49:18
 * @Description: 态势感知 相关接口
 * 来源：调度平台cnap-V2.1 态势感知大屏
 * 前缀 /cnap/monitor
 *
 */

import { GET, POST } from '@/utils/request'

const PREFIX = '/cnap'

/**
 * @description: 获取平台信息
 * @param {*} params
 * @return {*}
 */
export function getPlatformInfos(params) {
  return GET(PREFIX + '/monitor/cluster/getPlatformInfos', params)
}

/**
 * @description: 获取集群监控TOP5
 * @param {*} params
 * @return {*}
 */
export function getClusterTop5(params) {
  return GET(PREFIX + '/monitor/nssa/cpuTop5', params)
}

/**
 * @description: 获取集群监控TOP5
 * @param {*} params
 * @return {*}
 */
export function getClusterGpuTop5(params) {
  return GET('/monitor/nssa/gpuTop5', params)
}

/**
 * @description: 获取算力地图
 * @param {*} params
 * @return {*}
 */
export function getComputMap(params) {
  return GET(PREFIX + '/monitor/nssa/comput/map', params)
}

/**
 * @description: 获取集群下的节点
 * @param {*} params
 * @return {*}
 */
export function getNodeList(params) {
  return GET(PREFIX + '/monitor/nssa/comput/map/node', params)
}

/**
 * @description: 获取节点下的容器组
 * @param {*} params
 * @return {*}
 */
export function getContainerList(params) {
  return GET(PREFIX + '/monitor/nssa/comput/map/pod', params)
}

/**
 * @description: woring事件
 * @param {*} params
 * @return {*}
 */
export function getWoringInfo(params) {
  return POST(PREFIX + '/monitor/statistic/k8s-event/chart', params)
}

/**
 * @description: woring统计
 * @param {*} params
 * @return {*}
 */
export function getWoringStatistic(params) {
  return GET(PREFIX + '/monitor/statistic/alarm/chart/' + params)
}

/**
 * @description: 资源统计
 * @param {*} params
 * @return {*}
 */
export function getResourceStatistic(params) {
  return GET(PREFIX + '/monitor/nssa/resource/statistic', params)
}

/**
 * @description: 资源统计
 * @param {*} params
 * @return {*}
 */
export function getServiceMonitor(params) {
  return GET(PREFIX + '/monitor/nssa/recently/service', params)
}

/**
 * @description: 地图节点
 * @param {*} params
 * @return {*}
 */
export function getNodeMap(params) {
  return GET(PREFIX + '/monitor/nssa/map/location', params)
}

